/*
 *  Matrix.h
 *
 *  Created on: 2013-1-19
 *  Author: xuwei
 */

#ifndef _PANDAX_MATRIXTOOLS_H_
#define _PANDAX_MATRIXTOOLS_H_
#ifdef __cplusplus
extern "C"
{
#endif

typedef float Matrix[16];
typedef float Vector[4];

void px_loadIdentityM(Matrix result);

void px_multiplyMM(Matrix r, Matrix leftM, Matrix rightM);

void px_orthoM(Matrix result, float left, float right, float bottom, float top, float near, float far);

void px_frustumM(Matrix result, float left, float right, float bottom, float top, float near, float far);

void px_rotateM(Matrix result, float angle, float x, float y, float z);

void px_translateM(Matrix result, float tx, float ty, float tz);

void px_scaleM(Matrix result, float sx, float sy, float sz);

void px_multiplyMV(Vector result, Matrix matrix, float x, float y, float z, float w);

void px_multiplyMV3(Vector result, Matrix matrix, float x, float y, float z);

void px_lookAtM(Matrix result,
					float eyeX, float eyeY, float eyeZ,
					float centerX, float centerY, float centerZ,
					float upX, float upY, float upZ);


#ifdef __cplusplus
}
#endif

#endif /* MATRIXTOOLS_H_ */
